var table;
var layer;
layui.use(['layer','table'],function(){
    table=layui.table;
    layer=layui.layer;
    selCourseRecord()
});

//获取商品审核详情数据
function selCourseRecord() {
    var productId = localStorage.getItem("productId");
    $.ajax({
        url: "/SyOperationController/getAuditDetails",
        type: "post",
        dataType: "json",
        data:{"type":3,"productId":productId},    //商品type是3，把商品id传入
        success: function (data) {
            getTable(data.data);
        }
    });
}

//获取商品审核详情数据赋值给table
function getTable(data){
    table.render({
        elem:"#table_id",//容器
        data:data,
        title:"审核详情",
        limit:10,//分页显示条数
        toolbar:false,
        page:true,
        cols:[[//定义列
            //{type:'checkbox',align:'center',width:50},//复选框靠左
            {title:'序号',align:'center',width:60,templet:function(data){
                    return data.LAY_INDEX;
                }},
            {field:"time",title:"审核时间",align:'center',width:240,templet:function(d){
                    var date=d.time;
                    date = date.slice(0, date.indexOf("."));
                    date = date.replaceAll('T',' ');
                    return date;
                }},
            {field:"name",title:"审核人员",align:'center',width:130},
            {field:"result",title:"审核结果",align:'center',width:110},
            {field:"details",title:"反馈详情",align:'center',width:264}
        ]]
    });

}